var express = require('express');
var router = express.Router();
var test = require('../model/test.js');
/* GET home page. */
router.get('/', function(req, res, next) {
    console.log("进入test");
    var func = req.query.func;

    var info = {
        name: "chong",
        count: 20,
        bestseason: "冬天",
        likes: 10,
        comments: 10
    };
    if (func == "setInfo") {
        test.save(info, function(err) {
            if (err) {
                res.send(500, { message: err });
            } else {
                res.sendStatus(200);
            }
        });
    };
});
module.exports = router;
